package com.alex.designPattern.observer.selfDefined;

import java.util.ArrayList;
import java.util.List;

public abstract class Observable {
	
	List<Observer> observers = new ArrayList<Observer>();
	
	public void  addObserver(Observer observer) {
		observers.add(observer);
	}
	
	public void remove(Observer observer){
		observers.remove(observer);
	}
	
	public void updateAll(){
		for(Observer obser : observers){
			obser.update();
		}
	}
}
